#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<map>
#include<set>
using namespace std;
#include "MyMap.h"
#include "MySet.h"


void func(const Sim::map<int, int>& m)
{
	Sim::map<int, int>::const_iterator itm = m.begin();
	while (itm != m.end())
	{
		//itm->first = 1;
		//itm->second = 1;
		cout << (*itm).first << " " << itm->second << endl;
		++itm;
	}
	cout << endl;
}

void test1()
{
	Sim::map<int, int> m;
	m.insert(make_pair(1, 1));
	m.insert(make_pair(2, 2));
	m.insert(make_pair(3, 3));
	m.insert(make_pair(5, 5));
	m.insert(make_pair(3, 3));
	m.insert(make_pair(4, 4));


	Sim::map<int, int>::iterator itm = m.begin();
	while (itm != m.end())
	{
		itm->second = 1;
		cout << (*itm).first << " " << itm->second << endl;
		++itm;
	}
	cout << endl;

	Sim::set<int> s;
	s.insert(1);
	s.insert(2);
	s.insert(3);
	s.insert(2);
	s.insert(5);
	s.insert(0);

	Sim::set<int>::iterator it = s.begin();
	while (it != s.end())
	{
		//*it += 1;
		cout << *it << " ";
		++it;
	}
	cout << endl;
}
void test2()
{
	Sim::map<int, int> m;
	m.insert(make_pair(5, 5));
	m[1] = 2;
	m[2] = 3;
	m[4] = 5;
	m[5] = 1;
	Sim::map<int, int>::iterator itm = m.begin();
	while (itm != m.end())
	{
		cout << (*itm).first << " " << itm->second << endl;
		++itm;
	}
	cout << endl;
}

int main()
{
	test2();

	return 0;
}